package com.maybach.workflow.core.manager.impl;

import com.maybach.util.query.support.PageResult;
import com.maybach.workflow.common.model.FlowTaskActorDO;
import com.maybach.workflow.common.query.FlowTaskActorQuery;
import com.maybach.workflow.core.dal.mapper.ext.FlowTaskActorExtMapper;
import com.maybach.workflow.core.manager.FlowTaskActorManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * Manager for FlowTaskActor.
 */

@Component
public class FlowTaskActorManagerImpl implements FlowTaskActorManager{
    protected Logger log = LoggerFactory.getLogger(this.getClass());

    
    @Autowired
    protected FlowTaskActorExtMapper flowTaskActorExtMapper;
    /**
     * query count by query condition.
     */
    @Override
    public int countByQuery(FlowTaskActorQuery query){
        return flowTaskActorExtMapper.countByQuery(query);
    }

    /**
     * delete by query condition.
     */
    @Override
    public int deleteByQuery(FlowTaskActorQuery query){
        return flowTaskActorExtMapper.deleteByQuery(query);
    }

    /**
     * delete by primary key.
     */
    @Override
    public int deleteByPrimaryKey(Long id){
        return flowTaskActorExtMapper.deleteByPrimaryKey(id);
    }

    /**
     * insert selective.
     */
    @Override
    public long insertSelective(FlowTaskActorDO record){
        return flowTaskActorExtMapper.insertSelective(record);
    }

    /**
     * select by query condition.
     */
    @Override
    public List<FlowTaskActorDO> selectByQuery(FlowTaskActorQuery query){
        return flowTaskActorExtMapper.selectByQuery(query);
    }

    /**
     * select by query condition with page.
    */
    @Override
    public PageResult<FlowTaskActorDO> selectByQueryWithPage(FlowTaskActorQuery query) {
        PageResult<FlowTaskActorDO> result = new PageResult<FlowTaskActorDO>();
        result.setPageSize(query.getPageSize());
        result.setPageNo(query.getPageNo());
        result.setTotalCount(this.countByQuery(query));
        result.setResult(this.selectByQuery(query));
        return result;
    }

    /**
     * select by primary key.
     */
    @Override
    public FlowTaskActorDO selectByPrimaryKey(Long id){
        return flowTaskActorExtMapper.selectByPrimaryKey(id);
    }

    /**
     * update by query condition selective.
     */
    @Override
    public int updateByQuerySelective( FlowTaskActorDO record,  FlowTaskActorQuery query){
        return flowTaskActorExtMapper.updateByQuerySelective(record,  query);
    }

    /**
     * update by query condition.
     */
    @Override
    public int updateByQuery( FlowTaskActorDO record,  FlowTaskActorQuery query){

        return flowTaskActorExtMapper.updateByQuery(record, query);
    }

    /**
     * update by primary key selective.
     */
    @Override
    public int updateByPrimaryKeySelective(FlowTaskActorDO record){
        return flowTaskActorExtMapper.updateByPrimaryKeySelective(record);
    }
}